Skip to content

RDK-60236 : Remote Debugger Supports UUID Information in Debug Report File - #194

Merged
Abhinavpv28 merged 1 commit into
developfrom
feature/RDK-60236_aearchremoved
May 14, 2026
Merged

RDK-60236 : Remote Debugger Supports UUID Information in Debug Report File#194
Abhinavpv28 merged 1 commit into
developfrom
feature/RDK-60236_aearchremoved

Conversation

@Abhinavpv28

@Abhinavpv28 Abhinavpv28 commented May 8, 2026

Copy link
Copy Markdown
Contributor

Reason For Change : Remote Debugger Supports UUID Information in Debug Report File

Copilot AI review requested due to automatic review settings May 8, 2026 05:00
@Abhinavpv28
Abhinavpv28 requested a review from a team as a code owner May 8, 2026 05:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces support for parsing an “issue type” into a sanitized base value plus an optional suffix, persists that suffix through the processing pipeline, and updates upload/name-sanitization behavior so hyphens in suffix tokens can be preserved for downstream consumers.

Changes:

  • Add data_buf::suffix and initialize/free it in the data buffer lifecycle.
  • Add split_issue_type() utility and update issue-type event processing to split/sanitize only the base while preserving a bounded suffix.
  • Update upload sanitization to preserve hyphens and expand unit tests to cover new parsing/suffix behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/unittest/rrdUnitTestRunner.cpp Updates and adds unit tests for issue-type splitting, suffix parsing, buffer init/dealloc, and hyphen preservation.
src/rrdJsonParser.h Exposes the new split_issue_type() helper.
src/rrdJsonParser.c Implements split_issue_type(), adds suffix cleanup, and uses suffix when building the upload issue name.
src/rrdInterface.c Initializes and frees the new data_buf::suffix field.
src/rrdEventProcess.c Splits issue type tokens into base/suffix and sanitizes base only; adds GTest guards around JSON parsing paths.
src/rrdCommon.h Extends data_buf with a suffix pointer.
src/rrd_logproc.c Preserves hyphens during issue-type sanitization for archive/portal filename semantics.
.gitignore Adds ignore rules for autotools/build artifacts and unit test outputs.

Comment thread src/rrdJsonParser.c Outdated
Comment thread src/rrdJsonParser.c
Comment thread src/rrdEventProcess.c Outdated
Comment thread src/rrdEventProcess.c Outdated
Copilot AI review requested due to automatic review settings May 8, 2026 06:09
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown

Code Coverage Summary

                               Total:|84.1%   6195|97.3%  1648|    -      0

2 similar comments
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown

Code Coverage Summary

                               Total:|84.1%   6195|97.3%  1648|    -      0

@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown

Code Coverage Summary

                               Total:|84.1%   6195|97.3%  1648|    -      0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

src/rrdEventProcess.c:733

  • issueTypeSplitter() no longer removes special characters from the input before splitting (the sanitization call was removed), but its doc comment still describes pre-splitting special-character removal. Please update the doc comment to reflect the new behavior to avoid misleading future changes/tests.
    char *str = input_str;

    while (*str == delimeter)
        str++;

    char *str2 = str;

Comment thread src/rrdJsonParser.c Outdated
Comment thread src/rrdEventProcess.c
Comment thread src/rrdEventProcess.c
Comment thread src/rrdEventProcess.c
Comment thread src/rrd_logproc.c
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown

Code Coverage Summary

                               Total:|84.2%   6222|97.3%  1660|    -      0

Copilot AI review requested due to automatic review settings May 8, 2026 06:48
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown

Code Coverage Summary

                               Total:|84.2%   6225|97.3%  1660|    -      0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.

Comment thread src/rrdJsonParser.c Outdated
Comment thread src/rrdEventProcess.c
Comment thread src/rrd_logproc.c
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                               Total:|84.2%   6225|97.3%  1660|    -      0

Copilot AI review requested due to automatic review settings May 11, 2026 04:02
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                               Total:|84.2%   6226|97.3%  1660|    -      0

1 similar comment
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                               Total:|84.2%   6226|97.3%  1660|    -      0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

src/rrdJsonParser.c:33

  • RRD_MAX_SUFFIX_LEN is defined as 10, but the docstring and unit tests describe/enforce a maximum suffix length of 9 characters (including the leading '_'). This mismatch will cause the implementation to accept 10-char suffixes even though the documented contract says it should discard anything longer than 9. Please align the constant, documentation, and tests (either change the define to 9, or update the documented boundary/tests accordingly).
#include <sys/types.h>
#include <ctype.h>
#define RRD_MAX_SUFFIX_LEN  10

/*
 * @function removeSpecialChar
 * @brief Removes special characters ('\r' and '\n') from the device properties parameter string.
 * @param char *str - The string from which special characters will be removed.
 * @return void

Comment thread src/rrdRunCmdThread.c Outdated
Comment thread src/rrdRunCmdThread.c Outdated
Comment thread src/rrdEventProcess.c
Comment thread src/rrdRunCmdThread.c
Copilot AI review requested due to automatic review settings May 11, 2026 04:15
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                               Total:|84.2%   6226|97.3%  1660|    -      0

@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                               Total:|84.2%   6224|97.3%  1660|    -      0

@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                               Total:|84.1%   6224|97.3%  1660|    -      0

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comment thread src/rrdJsonParser.c
Comment thread src/rrdEventProcess.c
Comment thread src/rrdRunCmdThread.c
@Abhinavpv28 Abhinavpv28 changed the title Feature/rdk 60236 aearchremoved RDK-60236 : Remote Debugger Supports UUID Information in Debug Report File May 12, 2026
Update rrdEventProcess.c

Update rrdExecuteScript.c

Refactor rrdEventProcess.h to rrdExecuteScript.h

Update rrdExecuteScript.h

Update rrdExecuteScript.h

Update rrdEventProcess.h

Update rrdExecuteScript.h

Update rrdJsonParser.c

Update rrdJsonParser.h

Update rrdInterface.c

Update rrdCommon.h

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Fix indentation for appendMode assignment

Update rrdCommon.h

Fix appendMode assignment in rrdEventProcess.c

Update rrdEventProcess.c

Update rrdJsonParser.c

Update rrdEventProcess.c

Update rrdExecuteScript.h

Update rrdExecuteScript.c

Update rrdExecuteScript.c

Update rrdExecuteScript.c

Remove redundant logging from rrdJsonParser

Update rrdJsonParser.c

Update rrdEventProcess.c

Update rrdJsonParser.c

Update rrdEventProcess.c

Update rrdJsonParser.c

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdEventProcess.c

Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update rrdJsonParser.c

Fix heap overflow in issueTypeSplitter and memory leaks in suffix handling

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/fbc52780-966b-4912-825f-3030aa43c3e9

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Update rrdUnitTestRunner.cpp

Delete .gitignore

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdUnitTestRunner.cpp

Update rrdEventProcess.c

Update rrdUnitTestRunner.cpp

Update rrdUnitTestRunner.cpp

Add gtest test cases for split_issue_type

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/9996d741-248e-4e58-8689-b4ba873cfaf2

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Remove build artifacts, add .gitignore

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/9996d741-248e-4e58-8689-b4ba873cfaf2

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Add explicit truncated content assertion in SuffixTruncatedWhenTooSmall test

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/9996d741-248e-4e58-8689-b4ba873cfaf2

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Update rrdEventProcess.c

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Update rrdJsonParser.c

Update rrdJsonParser.c

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Update rrdUnitTestRunner.cpp

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Delete .gitignore

Delete src/unittest/UTJson/device.properties

Update rrdEventProcess.c

Add gtest tests for split_issue_type, suffix field, and processIssueTypeEvent

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/76cad72a-f67f-4c05-8fb5-bfadf0c173b3

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Delete .gitignore

Validate suffix prefix: only _Search- and _LogSearch- are allowed

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/125526c2-7b70-48f5-8bec-fd725eea8a04

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Base never contains underscore: split at first _ and discard invalid suffix

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/904bf10d-546b-4038-a60c-9bc76094a225

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Update rrdEventProcess.c

Update rrdUnitTestRunner.cpp

Update rrdEventProcess.c

Update rrdEventProcess.c

Fix segfault in GTEST_ENABLE mode when rbuf->jsonPath is NULL

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/efdc0d6b-89e6-4423-b202-a900f5683839

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Remove accidentally committed dummy directory and update .gitignore

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/efdc0d6b-89e6-4423-b202-a900f5683839

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Fix IssueTypeSplitterTest to match new issueTypeSplitter behavior (no built-in special-char removal)

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/00abcaba-8a41-4b88-ae12-07b5ff780ff9

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Fix empty/whitespace IssueType bypassing processIssueTypeEvent guards

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/4de31e24-70d8-496c-ac6a-a5376771d936

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

fix: preserve hyphens in archive filename so portal can parse it correctly

rrd_logproc_convert_issue_type() was converting '-' to '_', turning the
suffix '_Search-67768-67' into '_SEARCH_67768_67'. This added extra '_'
separators into the archive filename that broke the analytics portal's
filename parser — it could no longer identify the timestamp field, so
download requests used an incorrect S3 key.

Fix: keep '-' as '-' in the sanitized output. The archive filename now
uses '_' to separate structural fields (MAC, issueType, timestamp) and
'-' within the UUID suffix, giving the portal a reliable delimiter.

Also increase issue_type_sanitized buffer in uploadRRDLogs.c from 64 to
256 bytes so a full UUID suffix never causes a silent truncation failure.

Before: 04B86A12F9F8_DEVICE_DEVICEIP_SEARCH_67768_67_<timestamp>_RRD_DEBUG_LOGS.tgz
After:  04B86A12F9F8_DEVICE_DEVICEIP_SEARCH-67768-67_<timestamp>_RRD_DEBUG_LOGS.tgz

All 331 tests pass.

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/981b6bc1-c9d2-4150-9e9d-851004942ffc

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

fix: replace _Search-/_LogSearch- prefix check with suffix length <= 9 rule

split_issue_type() now discards any suffix whose total length (including
the leading '_') exceeds 9 characters.  The old _Search-/_LogSearch-
prefix validation is removed entirely.

Rule:
  strlen(underscore) <= 9  → suffix accepted
  strlen(underscore)  > 9  → suffix discarded

This means:
  - Short session tokens (e.g. "_ab12345", 8 chars) are carried through
  - Long UUID-based suffixes like "_Search-b6877385-...) are discarded,
    preventing extra '_' delimiters from breaking the portal filename parser

Affected tests updated:
  - UnderscoreSplitsBaseAndSuffix : uses a short accepted suffix
  - MultipleUnderscoresSplitsAtFirst: "_def_ghi" (8 chars) now kept
  - BaseTruncatedWhenTooSmall / ExactFitBase: "_suffix" (7 chars) now kept
  - SuffixTruncatedWhenTooSmall: uses 9-char suffix with 5-byte buffer
  - OnlyUnderscoreInput: "_" (1 char) now kept
  - LogSearchSuffixIsValid → NineCharSuffixIsAccepted (boundary test)
  - SearchSuffixIsValid → LongSuffixIsDiscarded
  - InvalidSuffixPrefixDiscarded / SearchWithoutHyphenIsInvalid /
    LogSearchWithoutHyphenIsInvalid: updated comments (same outcomes)
  - ProcessIssueTypeEvntTest comments updated to reflect new rule

All 331 tests pass.

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/c6d6fc29-da2a-46af-a417-c2de67a18448

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

refactor: improve RRD_MAX_SUFFIX_LEN comment and rename length-based tests

- Expand the RRD_MAX_SUFFIX_LEN comment to explain why 9 chars is the limit
- Rename misleading test names that referenced old prefix-based validation:
    InvalidSuffixPrefixDiscarded → SuffixExceedingMaxLengthDiscarded
    SearchWithoutHyphenIsInvalid → SuffixSeventeenCharsDiscarded
    LogSearchWithoutHyphenIsInvalid → SuffixTwentyCharsDiscarded
- LongSuffixIsDiscarded: switch to a neutral _1234567890 example so the
  test does not imply any Search-specific behavior

All 331 tests pass.

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/c6d6fc29-da2a-46af-a417-c2de67a18448

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Update rrdJsonParser.c

Update uploadRRDLogs.c

Update uploadRRDLogs.c

Update rrdJsonParser.c

Delete .gitignore

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Update rrdEventProcess.c

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Update rrdJsonParser.c

Update rrdEventProcess.c

sanitize split_issue_type suffix to [A-Za-z0-9_-] to prevent injection

Agent-Logs-Url: https://github.com/rdkcentral/remote_debugger/sessions/72e164ed-ae53-4076-8fb1-5ff1e21375e9

Co-authored-by: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com>

Update rrdEventProcess.c

Delete .gitignore

Update rrdRunCmdThread.c

Update rrdRunCmdThread.h

Delete src/unittest/UTJson/device.properties

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Update rrdRunCmdThread.c

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Abhinavpv28
Abhinavpv28 force-pushed the feature/RDK-60236_aearchremoved branch from 37e81f5 to c56fef3 Compare May 13, 2026 16:49
@github-actions

Copy link
Copy Markdown

Code Coverage Summary

                               Total:|84.1%   6224|97.3%  1660|    -      0

@rdkcentral rdkcentral deleted a comment from Copilot AI May 13, 2026
@Abhinavpv28
Abhinavpv28 merged commit a90567e into develop May 14, 2026
13 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants